package dcc.component;

import java.awt.Component;

import javax.swing.border.EmptyBorder;

import com.l2fprod.common.swing.JTaskPane;
import com.l2fprod.common.swing.JTaskPaneGroup;

import dcc.tools.Tools;

public class JTaskPaneX extends JTaskPane {

	public JTaskPaneX() {
		super();
		setBorder(new EmptyBorder(4, 4, 4, 4));
		setDoubleBuffered(true);
	}

	public void callInformationManageButton(String managerName) {
		for (Component component : this.getComponents()) {
			if (component instanceof JTaskPaneGroup) {
				if (Tools.get().getValue("INFORMATIONMANAGE")
						.equals(((JTaskPaneGroup) component).getTitle())) {
					for (Component buttonComponent : ((JTaskPaneGroup) component).getContentPane()
							.getComponents()) {
						if (buttonComponent instanceof JLinkButtonX) {
							if (managerName
									.equals(((JLinkButtonX) buttonComponent)
											.getManagerName())) {
								((JLinkButtonX) buttonComponent).doClick();
							}
						}
					}
				}
			}
		}
	}
}
